/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package nodeLevelMetaModel.impl;

import java.util.Collection;

import nodeLevelMetaModel.MemberRole;
import nodeLevelMetaModel.NodeLevelMetaModelPackage;
import nodeLevelMetaModel.SamplingTask;
import nodeLevelMetaModel.SendingTask;
import nodeLevelMetaModel.TemporalAggregationTask;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.eclipse.emf.ecore.util.EObjectResolvingEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Member Role</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link nodeLevelMetaModel.impl.MemberRoleImpl#getName7 <em>Name7</em>}</li>
 *   <li>{@link nodeLevelMetaModel.impl.MemberRoleImpl#getName8 <em>Name8</em>}</li>
 *   <li>{@link nodeLevelMetaModel.impl.MemberRoleImpl#getName9 <em>Name9</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class MemberRoleImpl extends RoleImpl implements MemberRole {
	/**
	 * The cached value of the '{@link #getName7() <em>Name7</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName7()
	 * @generated
	 * @ordered
	 */
	protected SamplingTask name7;

	/**
	 * The cached value of the '{@link #getName8() <em>Name8</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName8()
	 * @generated
	 * @ordered
	 */
	protected EList<SendingTask> name8;

	/**
	 * The cached value of the '{@link #getName9() <em>Name9</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName9()
	 * @generated
	 * @ordered
	 */
	protected TemporalAggregationTask name9;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected MemberRoleImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return NodeLevelMetaModelPackage.Literals.MEMBER_ROLE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SamplingTask getName7() {
		if (name7 != null && name7.eIsProxy()) {
			InternalEObject oldName7 = (InternalEObject)name7;
			name7 = (SamplingTask)eResolveProxy(oldName7);
			if (name7 != oldName7) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, NodeLevelMetaModelPackage.MEMBER_ROLE__NAME7, oldName7, name7));
			}
		}
		return name7;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SamplingTask basicGetName7() {
		return name7;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setName7(SamplingTask newName7) {
		SamplingTask oldName7 = name7;
		name7 = newName7;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, NodeLevelMetaModelPackage.MEMBER_ROLE__NAME7, oldName7, name7));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<SendingTask> getName8() {
		if (name8 == null) {
			name8 = new EObjectResolvingEList<SendingTask>(SendingTask.class, this, NodeLevelMetaModelPackage.MEMBER_ROLE__NAME8);
		}
		return name8;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public TemporalAggregationTask getName9() {
		if (name9 != null && name9.eIsProxy()) {
			InternalEObject oldName9 = (InternalEObject)name9;
			name9 = (TemporalAggregationTask)eResolveProxy(oldName9);
			if (name9 != oldName9) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, NodeLevelMetaModelPackage.MEMBER_ROLE__NAME9, oldName9, name9));
			}
		}
		return name9;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public TemporalAggregationTask basicGetName9() {
		return name9;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setName9(TemporalAggregationTask newName9) {
		TemporalAggregationTask oldName9 = name9;
		name9 = newName9;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, NodeLevelMetaModelPackage.MEMBER_ROLE__NAME9, oldName9, name9));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case NodeLevelMetaModelPackage.MEMBER_ROLE__NAME7:
				if (resolve) return getName7();
				return basicGetName7();
			case NodeLevelMetaModelPackage.MEMBER_ROLE__NAME8:
				return getName8();
			case NodeLevelMetaModelPackage.MEMBER_ROLE__NAME9:
				if (resolve) return getName9();
				return basicGetName9();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case NodeLevelMetaModelPackage.MEMBER_ROLE__NAME7:
				setName7((SamplingTask)newValue);
				return;
			case NodeLevelMetaModelPackage.MEMBER_ROLE__NAME8:
				getName8().clear();
				getName8().addAll((Collection<? extends SendingTask>)newValue);
				return;
			case NodeLevelMetaModelPackage.MEMBER_ROLE__NAME9:
				setName9((TemporalAggregationTask)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case NodeLevelMetaModelPackage.MEMBER_ROLE__NAME7:
				setName7((SamplingTask)null);
				return;
			case NodeLevelMetaModelPackage.MEMBER_ROLE__NAME8:
				getName8().clear();
				return;
			case NodeLevelMetaModelPackage.MEMBER_ROLE__NAME9:
				setName9((TemporalAggregationTask)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case NodeLevelMetaModelPackage.MEMBER_ROLE__NAME7:
				return name7 != null;
			case NodeLevelMetaModelPackage.MEMBER_ROLE__NAME8:
				return name8 != null && !name8.isEmpty();
			case NodeLevelMetaModelPackage.MEMBER_ROLE__NAME9:
				return name9 != null;
		}
		return super.eIsSet(featureID);
	}

} //MemberRoleImpl
